<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <script language="javascript" type="text/javascript">
            var excelApp;
            var excelWorkBook;
            var excelSheet;
            
            



            readExcel();

            function readExcel(filePath) {
                
                try {
                    var tempStr = "";
                    var filePath = "D:\\Book1.xls";
                    var excelApp = new ActiveXObject("Excel.application");
                    var excelWorkBook = excelApp.Workbooks.open(filePath);
                    excelWorkBook.worksheets(1).select();
                    var excelSheet = excelWorkBook.ActiveSheet;
                    excelSheet.Cells(1, 1).value; //cell的值 
                    alert(excelSheet.Cells(1, 1).value);
                    alert(excelSheet.Cells(1, 2).value);
                    alert(excelSheet.Cells(2, 1).value);
                    excelSheet.usedrange.rows.count; //使用的行数 
                    alert(excelSheet.usedrange.rows.count);
                    excelWorkBook.Worksheets.count; //得到sheet的个数 
                    excelSheet = null;
                    excelWorkBook.close();
                    excelApp.Application.Quit();
                    excelApp = null;
                } catch (e) {
                    if (excelSheet != null || excelSheet != undefined) {
                        excelSheet = nul;
                    }
                    if (excelWorkBook != null || excelWorkBook != undefined) {
                        excelWorkBook.close();
                    }
                    if (excelApp != null || excelApp != undefined) {
                        excelApp.Application.Quit();
                        excelApp = null;
                    }
                }
            }
            
            function stopExcel()
            {
                excelWorkBook.close();
                excelApp.Application.Quit();
                excelApp = null;
            }
        </script> 

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
        <div>TODO write content123</div>
    </body>
</html>
